package com.wudl.db.controller;

import com.wudl.db.model.User;
import com.wudl.db.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @ClassName : UserController
 * @Description :
 * @Author :wudl
 * @Date: 2021-08-06 00:38
 */

@RestController
public class UserController {

    @Autowired
    UserService userService;
    @GetMapping("/getUser")
    public Object getUser()
    {
        List<User> users = userService.selectAllMaster();
        List<User> users1 = userService.selectAllSlave();
        Map<String ,Object> map= new HashMap<>();
        map.put("master",users);
        map.put("slave",users1);
        return map;
    }
}
